from datetime import datetime
from pydantic import BaseModel
from typing import List, Optional, Any

# 公告简略信息响应（列表）
class AnnouncementFilter(BaseModel):
    id: int
    name: str
    date_time: datetime  # 发布时间
    # location_id: List[int]  # 校区
    type_id: int
    poster: str
    publisher_name: str
    publisher_avatar: Optional[str]

    class Config:
        from_attributes = True

# 公告详细信息响应
class AnnouncementDetail(BaseModel):
    id: int
    name: str
    published_time: datetime
    # campus: List[int]
    type: int
    poster: str
    publisher_name: str
    publisher_avatar: Optional[str]

    class Config:
        from_attributes = True

